import Car.Factory;
import Car.car;

import java.util.ArrayList;
import java.util.List;
public class Main {
    public static void main(String[] args) {


        List<car> fruitList = new ArrayList<car>();

        fruitList.add(Factory.getFruitInstanceByType("大众"));
        fruitList.add(Factory.getFruitInstanceByType("宝马"));
        fruitList.add(Factory.getFruitInstanceByType("奔驰"));
        fruitList.add(Factory.getFruitInstanceByType("宝马"));
        fruitList.add(Factory.getFruitInstanceByType("奔驰"));

        for (car currentFruit : fruitList){
            System.out.println(currentFruit.showName());
        }






    }
}